'LEARN IN SPACE by Andy Paul--22 CEYLON PLACE, EASTBOURNE ,EAST SUSSEX,BN21 3JF
'If you feel that you would like to improve the graphical/sound side of this
'program then feel free,then re-distribute as ver 1.1,but please let me know
'about it,plus i'd like to see your improvements.............
Screen Open 0,320,256,16,Lowres : Cls 0
YEP=False
CHOOSE:
Screen Open 1,320,256,16,Lowres
Show
Load Iff "pics/menu1.iff" : Flash Off
Rem reserve space for 4 zones
Reserve Zone 4
Rem set them
Set Zone 1,90,102 To 226,125
Set Zone 2,90,134 To 226,158
Set Zone 3,90,164 To 226,188
Set Zone 4,90,198 To 226,222
OOPS:
Repeat
Until Mouse Key<>0
Rem check for which zone was chosen
X=Hzone(X Mouse,Y Mouse)
If X=1 Then ZZ=1 : YEP=True
If X=2 Then ZZ=2 : YEP=True
If X=3 and YEP=True Then Run "menu.amos"
If X=3 and YEP=False Then Screen Open 2,320,25,16,Lowres : Cls 6 : Paper 6 : Print " YOU MUST ADD or SUBTRACT BEFORE YOU CAN PLAY" : Wait 200 : Screen Close 2 : Gosub OOPS
If X=4 Then Gosub HELP
If X=0 Then Gosub OOPS
Load "bobs/maths.abk"
Screen Close 1
Hide
Load Iff "pics/numbers.iff"
Get Sprite Palette
Curs Off : Flash Off : Hide : Paper 11
Double Buffer
Dim V(16,2)
Gosub VECTORS
Noise To 15
MAIN:
Rem set up all the relevant values
POS=1 : SP#=0 : IB=1 : IC=22 : WRONG=0 : YES=0
XB=160 : Y#=128
VX#=0 : VY#=0
PC=0 : PD=2
SP#=0.1 : Rem acceleration speed
D#=0.99 : Rem deceleration / drag rate
Rem Use D#=0 to simulate the vacuum of space (!?)
G#=0.05 : Rem gravity
BF#=0.5 : Rem bounce factor
NXT=1
Rem put the balls with numbers in at their places
Gosub NUMBERS
'
Gosub QUESTION
Do
If Fire(1) Then Gosub ISITRIGHT
If Jright(1) Then Add IB,1,1 To 5 : Inc XB : Inc XB
If PC=PD Then PC=0
If Jleft(1) Then Add IB,1,6 To 10 : Dec XB : Dec XB
If PC=PD Then PC=0
If Jup(1) Then VX#=VX#+V(POS,1)*SP# : VY#=VY#+V(POS,2)*SP# : Play 20,1
OX#=X# : OY#=Y#
X#=X#+VX#
Y#=Y#+VY#
VY#=VY#+G#
VX#=VX#*D# : VY#=VY#*D#
If X#>320 Then X#=-20
If X#<-20 Then X#=320
' next bit does the bounce:
If Y#>165 Then Y#=165 : VY#=VY#*-BF#
If Y#<13 Then Y#=13 : VY#=-VY# : VX#=-VX#
Bob 10,XB,Y#,IB
If Bob Col(10,1 To 9) Then Gosub GOTNUM
'if you erase the next line,the bear goes TOO fast ! !
Wait Vbl
Loop
'
VECTORS:
For N=1 To 16
Read V(N,1),V(N,2)
Next
Return
Data 0,-2,1,-2,2,-2,2,-1,2,0
Data 2,1,2,2,1,2,0,2
Data -1,2,-2,2,-2,1,-2,0
Data -2,-1,-2,-2,-1,-2
Rem this sub places the numbers
NUMBERS:
Pen 1
Locate 22,28 : Print "CORRECT 0 "
Pen 10
Locate 22,30 : Print "WRONG 0 "
BX=80
For A=11 To 16
Bob A,BX,198,22
BX=BX+10
Next A
BX=170
For A=17 To 22
Bob A,BX,198,22
BX=BX+10
Next A
Rem the next two lines decide on a + sign or -
If ZZ=1 Then Bob 23,150,198,11
If ZZ=2 Then Bob 23,150,198,12
Rem the next 3 lines places bobs 1 to 5 in a row
For A=1 To 5
Bob A,A*50,20,A+12
Next A
Rem this does the bottom row
Bob 6,60,80,18 : Bob 7,120,80,19 : Bob 8,180,80,20 : Bob 9,240,80,21
Return
GOTNUM:
For B=1 To 9
If Col(B) Then Locate 14,29 : Print B : Y#=Y#+40 : Return
Next B
Return
QUESTION:
Pen 4
Rem if zz=2 means if the user chose subtract
Rem A=the answer it should be
Rem BL=says how many balls on the left should be shown